#pragma once
#include <algorithm>
#include <concepts>
#include <iterator>
#include <utility>

template <std::forward_iterator Iter>
void quickSort(Iter begin, Iter end) {
	if (std::distance(begin,end) < 2) return;

	auto pivot = *begin;

	Iter mid = std::partition(begin + 1, end, [pivot](const auto& elem) {return elem < pivot; });

	std::iter_swap(begin, mid - 1);

	quickSort(begin, mid);
	quickSort(mid, end);
}